<template>
  <div class="viphallOrder">
     <div style="margin:0 0 20px 0">会员卡号：{{customernumber.customerCard}}</div>
      <el-button style="margin:0 0 10px 95%" type="primary" size="mini" @click="returntop">返回</el-button>
    <!-- 表格 -->
    <div class="table">
      <el-table
        size="mini"
        :header-cell-style="{
          color: '#fff',
          background: '#6090EC',
          fontSize: '11px',
          fontWeight: 'normal',
        }"
        :data="dataList"
        border
        style="width: 100%"
      >
        <el-table-column prop="orderNum" label="订单号"> </el-table-column>
        <el-table-column prop="departureCity" label="城市"> </el-table-column>
        <el-table-column width="100px" prop="airport" label="机场">
        </el-table-column>
        <el-table-column
          width="100px"
          prop="departureAirportterminalname"
          label="航站楼"
        >
        </el-table-column>
        <el-table-column width="100px" prop="contactName" label="姓名">
        </el-table-column>

        <el-table-column width="100px" prop="cardNumber" label="会员卡号">
        </el-table-column>
        <el-table-column width="130px" prop="contactPhone" label="手机号">
        </el-table-column>
        <el-table-column width="130px" prop="sourceCompanyid" label="订单来源">
        </el-table-column>
        <el-table-column width="130px" prop="createTime" label="下单日期">
          <template slot-scope="scope">
            {{ showcreatTime(scope.row.createTime) }}
          </template>
        </el-table-column>
        <el-table-column width="130px" prop="departureTime" label="起飞时间">
        </el-table-column>

        <el-table-column width="130px" prop="flightNumber" label="航班号">
        </el-table-column>

        <el-table-column width="130px" prop="state" label="订单状态">
          <template slot-scope="scope">
            <template v-if="scope.row.state == 'paid'">已支付</template>
            <template v-if="scope.row.state == 'unpaid'">未支付</template>
            <template v-if="scope.row.state == 'Cancellation'">取消</template>
            <template v-if="scope.row.state == 'completed'">已完成</template>
          </template>
        </el-table-column>

        <el-table-column width="130px" prop="checkinserviceId" label="值机方式">
          <template slot-scope="scope">
            <template v-if="scope.row.checkinserviceId == 'online'"
              >网上值机</template
            >
            <template v-if="scope.row.checkinserviceId == 'offline'"
              >线下值机</template
            >
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
export default {
  name: "viphallOrder",
  data() {
    return {
      dataList:[],
      customerId:"",
      customernumber:{},
      currentPage:'',
pageSize:''
    };
  },
  methods: {
    // 时间显示
    showcreatTime(val) {
      var val1 = val.split(".");
      var val2 = val1[0].split("T").join(" ");
      return val2;
    },
     // 返回
    returntop(){
      this.$router.go(-1)
    },
     // 会员卡号
    getinformation(){
      this.$axios.getinformation({
        id:this.customerId,
        // id:'77'
      }).then((res)=>{
        console.log(res)
        this.customernumber=res.data
        if(res.code==200){
          this.getselectVipchannelOrederList()
        }
      })
    },
    // 登机牌订单列表
    getselectVipchannelOrederList() {
      localStorage.setItem("pageNum", this.currentPage);
      localStorage.setItem("pageSize", this.pageSize)
      localStorage.setItem("isToken", true);
      this.$axios
        .getselectVipchannelOrederList({
          departmentId: '', //部门id
          customerCard: '', //会员卡号
          serviceSource: '', //服务来源
          orderState: '', //订单状态
          orderSource: '', //订单来源
          name: '', //姓名
          phone: this.customernumber.customerPhone, //手机号
          orderNum: '', //订单编号
          orderDateForward: '', //下单日期前
          orderDateBack: '', //下单日期后
          serveDateForward: '', //服务日期前
          ServeDateBack: '', //服务日期后
          checkMethod: '', //值机方式
           
        })
        .then((res) => {
          console.log(res);
          if (res.code == "200") {
            this.dataList = res.data;
            this.pageTotal = res.total;
            
            if (!this.pageTotal) {
              this.$message({
                message: "当前日期暂无信息",
              });
            }
          }
        });
    },

  },

  mounted() {
        this.customerId = this.$route.params.customerId;
     this.getinformation()
  },
};
</script>
<style scoped>
.viphallOrder{
  margin: 20px;
}
</style>